package org.yefei.homeworkday13;

import java.util.Scanner;

public class TestCompany {

	public static void main(String[] args) {
		//创建公司对象
		Company com=new Company();
		
		int choice = 0;
		Scanner in = new Scanner(System.in);
		while (true) {
			System.out.println("1:招新员工，2：查看员工信息，3：辞退员工，4:统计公司人数，9：退出");
			choice = in.nextInt();
			if (choice == 1) {
				Workers worker = new Workers();
				System.out.println("新员工工号：");
				worker.wNumber = in.next();
				System.out.println("新员工姓名：");
				worker.name = in.next();
				System.out.println("新员工年龄：");
				worker.age = in.nextInt();
				System.out.println("新员工性别：");
				worker.gender = in.next();
				System.out.println("新员工职务：");
				worker.duty = in.next();
				System.out.println("新员工薪水：");
				worker.salary = in.nextDouble();
				com.addWorkers(worker);
			} else if (choice == 2) {
				com.showWorkers();
			} else if (choice == 3) {
				System.out.println("辞退员工的工号：");
				String yNum = in.next();
				com.deleWorkers(yNum);
			} else if (choice == 4) {
				int count = com.count();
				System.out.println("公司总人数有:" + count + "人");
			} else if (choice == 9) {
				break;
			} else {
				System.out.println("输入有误！重新输入：");
			}
		}
	}
}


